<template>
  <div class="header">
    <i class="el-icon-menu" @click="iszhankai"><span>&emsp;{{title}}</span></i>
   <el-dropdown>
  <img
        class="logo"
         :src="this.admin.avatarUrl"
        alt=""
      />
  <el-dropdown-menu slot="dropdown">
    <el-dropdown-item>个人中心</el-dropdown-item>
    <el-dropdown-item  @click.native="exct">退出</el-dropdown-item>
  </el-dropdown-menu>
</el-dropdown>
  </div>
</template>

<script>
export default {
  name: '',
  computed: {
    admin() {
      return this.$store.state.admin.data
    },
    title() {
      return this.$route.name
    },
  },
  methods: {
    iszhankai() {
      this.$store.commit('aside/iscoll')
      console.log(this.$store)
    },
    exct() {
      console.log(123123)
      localStorage.clear()
      this.$store.commit('admin/clear')
      this.$router.push({ path: '/login' })
    },
  },
}
</script>

<style lang="scss" scoped>
.header{
color: #fff;
}
 .el-dropdown-link {
    cursor: pointer;
    color: #409EFF;
  }
  .el-icon-arrow-down {
    font-size: 12px;
  }
.headerimg{
    width: 40px;
    height: 40px;
    border-radius:50% ;
    line-height: 50px;
}
i{
    font-size: 15px;
    cursor: pointer;
}
.logo{
  width: 30px;
  height: 30px;
  border-radius:50% ;
  cursor: pointer;
  vertical-align: middle;
}
el-dropdown-menu{
  margin-top:-20px ;
}
</style>
